import { Mode } from '@/core/interfaces/common'

export const promotionByGet = () => ({
  url: '/api/v1/ad/list',
  method: 'get'
})
// 折扣页的分页
export const pageRenewConf = () => ({
  url: '/api/v1/priceAsk/pageRenewConf',
  method: 'get'
})

export const promotionKeywordByGet = () => ({
  url: '/api/v1/ad/creative/list',
  method: 'get'
})

export const promotionAllCreativeByGet = () => ({
  url: '/api/v1/ad/creative/all',
  method: 'get'
})

export const promotionCreativeByUpdate = (mode: Mode) => ({
  url: mode === Mode.create ? '/api/v1/ad/word/creative/add' : '/api/v1/ad/word/creative/update',
  method: 'post'
})

export const promotionCreativeByGet = () => ({
  url: '/api/v1/ad/word/creative',
  method: 'get'
})

export const createCampaignByPost = () => ({
  url: '/api/v1/ad/campaign/add',
  method: 'post'
})

export const updateFreeWordByPost = () => ({
  url: '/api/v1/order/freeWord/add/batch',
  method: 'post'
})

export const singleWordCreativeByGet = () => ({
  url: '/api/v1/ad/creative',
  method: 'get'
})

export const checkPromotionUrlByGet = () => ({
  url: '/api/v1/ad/word/creative/regDomain/validate',
  method: 'get'
})

export const checkOnlineActivityByGet = () => ({
  url: '/api/v1/activity/isOnline',
  method: 'get'
})

export const promotionDetailByGet = () => ({
  url: '/api/v1/ad',
  method: 'get'
})

export const negativeWordsByGet = () => ({
  url: '/api/v1/ad/negativeWord/list',
  method: 'get'
})

export const negativeWordsByPost = (mode: Mode) => ({
  url: mode === Mode.create ? '/api/v1/ad/negativeWord/add' : '/api/v1/ad/negativeWord/update',
  method: 'post'
})

export const negativeWordsByRemove = () => ({
  url: '/api/v1/ad/negativeWord/del',
  method: 'get'
})

export const removeMigrationByGet = () => ({
  url: '/api/v1/ad/campaign/reAdd',
  method: 'get'
})

export const accountMigrationByGet = () => ({
  url: '/api/v1/ad/campaign/change',
  method: 'get'
})

export const pausePlanByGet = () => ({
  url: '/api/v1/ad/pause',
  method: 'get'
})

export const launchPlanByGet = () => ({
  url: '/api/v1/ad/start',
  method: 'get'
})

export const freeWordSuffixByGet = () => ({
  url: '/api/v1/order/freeWord/suffix/list',
  method: 'get'
})
// 编辑赠词
export const editConfigurationGift = () => ({
  url: '/api/v1/updateGiveWordNumber',
  method: 'post'
})
